package com.ssrs.platform.config;

import cn.hutool.core.util.StrUtil;
import com.ssrs.framework.Config;
import com.ssrs.framework.extend.annotation.ExtendItem;
import com.ssrs.platform.FixedConfigItem;
import com.ssrs.platform.PlatformPlugin;
import com.ssrs.platform.code.ControlType;
import com.ssrs.platform.code.DataType;
import com.ssrs.platform.extend.ConfigService;

/**
 * 系统管理员的用户名
 *
 * @author ssrs
 */
@ExtendItem(
        plugin = PlatformPlugin.class,
        extendService = ConfigService.class,
        description = "系统管理员的用户名配置项"
)
public class AdminUserName extends FixedConfigItem {
    public static final String ID = "Platform.AdminUserName";

    public AdminUserName() {
        super(ID, DataType.SHORTTEXT, ControlType.TEXT, "系统管理员的用户名");
    }

    public static String getValue() {
        String v = Config.getValue(ID);
        if (StrUtil.isEmpty(v)) {
            v = "admin";
        }
        return v;
    }

}
